home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / os2 / srefv12i.zip / postfilt.80 < prev    next >
Text File  |  1996-11-20  |  5KB  |  144 lines

  1. /* a sample of a SRE-FILTER "post-filter" - */
  2.  
  3. /* A very simple transaction recorder (use PMPRINTF to record it)*/
  4.  
  5. postfilt:
  6. parse arg amessage,source,request,sel,tempfile,servername,host_nickname,used_file,thereferer,tcache
  7. parse var source serveraddr serverport transaction_number clientaddr clientport
  8. sel=packur(sel)
  9. request=packur(request)
  10. CALL PMPRINTF("  - - - - - ")
  11. AT=time() ; AD=date()
  12. CALL PMPRINTF(AT ' ' AD)
  13. CALL PMPRINTF( "      Status Message = "  amessage)
  14. CALL PMPRINTF( "         From Server =  " servername)
  15. CALL PMPRINTF( "      Client address = "  clientaddr)
  16. cALL PMPRINTF( " Sel (requested URL) = "  sel)
  17. call pmprintf( ' File sent (or used) = ' Used_file)
  18. return ' '
  19.  
  20.  
  21. /*******************************************************************
  22.  *******************************************************************
  23.  *******************************************************************/
  24.  
  25. /*
  26.          ---------------- General notes  ------------------------
  27.  
  28. SRE-FILTER  call this procedure when the POST_FILTER variable is set to YES,
  29. and POSTFILTER_NAME='POSTFILT.80'.
  30.  
  31. Reminder: You can "chain" post filters (see INITFILT.DOC for details)!
  32.  
  33. 8 arguments are passed here:
  34.     amessage
  35.     source
  36.     request
  37.     sel0
  38.     tempfile
  39.     servername
  40.     host_nickname
  41.     used_file
  42.  
  43. Amessage 
  44.     is generated by SRE-FILTER, and indicates what SRE-FILTER did with this request.
  45.  
  46. Source,request,and sel0 are generated by GoServe, and contain:
  47.  
  48.   Source 
  49.        serveraddr serverport transaction_number clientaddr clientport
  50.   Request
  51.     verb uri protocol 
  52.   Sel0
  53.     action '?' awords  (?awords may not be present).  Note that to avoid
  54.     parsing problems, commas are converted to %2c -- you can convert them
  55.     back using the PACKUR function.
  56.  
  57. Tempfile is set in SRE-FILTER
  58.   Tempfile
  59.     A temporary file name. It may have been used to construct the response, so you probably should
  60.     delete it first (use SYSFILEDELETE(TEMPFILE) ).
  61.  
  62. Servername
  63.    The name of the server to whom this request was directed.  This
  64.    may be an alias (if you have an appropriate HOSTS. entry).
  65.  
  66. Host_nickname
  67.     The "nickname" for this servername -- used by SRE-Filter when
  68.     looking up parameters, access control, etc.
  69.  
  70. USED_FILE
  71.    The file actually used by SRE-Filter.  Examples include:
  72.         the document or .GIF  file sent in response to the request.  
  73.         the CGI script executed.
  74.  
  75. TheReferer
  76.    The value of the 'referer' request header -- if set, it contains
  77.    the absolute url which contained the link which invoked this request.
  78.  
  79. Example of arguments sent:
  80.      amessage               HTML File sent:/INDEX.HTM
  81.      Source                151.121.65.143 80 3 219.134.78.12 1026
  82.      request                GET /sampask2.htm HTTP/1.0
  83.      sel0                   sampask2.htm
  84.      tempfile               D:/GOHTTP/$10.80
  85.      servername             www.oursite.net
  86.      host_nickname          www1   
  87.      params                mail.myprovider.net
  88.      used_file             D:\WWW\SAMPASK2.HTM
  89.  
  90. Note on Amessage:
  91.   The folllowing lists the "messages" that SRE-FILTER may send.  Note that the ||varname
  92.   means the value of Varname is appended to the message.  Also note that when varname=SEL,
  93.   the SEL may be different then SEL0 (say, if a ~ replacement occurred).
  94.   AWORDS is stuff following a ? in the SEL, ACTION is the stuff before a ?,
  95.   AFILE is a file name
  96.  
  97. Note on host_nickname:
  98.    On single host servers, where there are no HOSTS. entries, host_nickname
  99.    will be blank.
  100.  
  101.  
  102. ------------------------------------------------------------
  103.  
  104. The following contains an almost complete list of "amessages" .
  105. Note that AN_ARG depends on the request.
  106.  
  107. Bad request for public file  
  108. Pre-filter used 
  109. Cached file sent: AN_ARG 
  110. Bad HTTP Protocol  
  111. Literal public file not found:  AN_ARG
  112. Literal public file returned:  AN_ARG
  113. Unauthorized access  
  114. No client name found, access denied 
  115. Logon denied to non-inhouse user  
  116. Pre-filter used 
  117. Alias invoked redirect  
  118. Transfered non-data directory file:  AN_ARG 
  119. CGI-BIN call:  AN_ARG 
  120. HEAD request: Document not found:  AN_ARG 
  121. Head request  
  122. Head request with autoheader 
  123. Byte ranges in Non-HTML File sent: AN_ARG 
  124. Non-HTML File sent: AN_ARG 
  125. Remote Non-HTML File sent: AN_ARG 
  126. HTML File sent: AN_ARG 
  127. HTML File sent (with ssi): AN_ARG 
  128. Remote  post_filter_message 
  129. Mappable image request, file missing: AN_ARG
  130. Mappable image request: AN_ARG
  131. Script processor: not allowed  
  132. POST error: too much data
  133. POST error: could not read data = error_code
  134. Script processor: not allowed  
  135. PUT request:  AN_ARG 
  136. DELETE request: AN_ARG 
  137.  
  138.  
  139.  
  140.  
  141.  
  142. **************************************************************************/
  143.  
  144.